/*****************************************************
Copyright (C) 2020. All rights reserved.
File name     ：TestMain.c
Version       ：v1.0
Author        ：zhengqijun
Date          ：2020-04-08
Function List ：
Description   ：main function
******************************************************/

#include <stdio.h>  // for printf
#include "BinomialQueue.h"

#define MaxSize (50)

// main function
int main(void) {
    BinQueue H;
    int i;
    int j;

    H = Initialize();

    if (IsEmpty(H)) {
        printf("BinomialQueue is empty!\n");
    } else {
        printf("BinomialQueue is not empty!\n");
    }

    printf("Insert binomial queue: [ ");
    for (i = 1, j = MaxSize / 2; i < MaxSize; i += 3) {
        printf("%02d ", j);
        Insert(j, H);
        j = (j + 21) % MaxSize;
    }
    printf("]\n");

    printf("Print binomial queue:\n");
    PrintBinQueue(H, 0);
    printf("\n");

    printf("Find min element is %d in binomial queue!\n", FindMin(H));
    printf("Delete min element is %d in binomial queue!\n", DeleteMin(H));

    printf("Print binomial queue:\n");
    PrintBinQueue(H, 0);
    printf("\n");

    printf("Delete min element is %d in binomial queue!\n", DeleteMin(H));

    printf("Print binomial queue:\n");
    PrintBinQueue(H, 0);
    printf("\n");

    Destroy(H);

    return 0;
}

// EOF

